import {
	mapMutations
} from 'vuex'

export default {


	touchStart(e) {
		console.log("触摸开始")
		this.touchStartX = e.touches[0].clientX;
		this.touchStartY = e.touches[0].clientY;
	},
	touchEnd(e) {
		console.log("触摸结束")
		let deltaX = e.changedTouches[0].clientX - this.touchStartX;
		let deltaY = e.changedTouches[0].clientY - this.touchStartY;
		if (Math.abs(deltaX) > 50 && Math.abs(deltaX) > Math.abs(deltaY)) {
			if (deltaX >= 0) {
				this.showGuide = false
				console.log("左滑")
			} else {
				console.log("右滑")
				this.showGuide = false
			}
		} else if (Math.abs(deltaY) > 50 && Math.abs(deltaX) < Math.abs(deltaY)) {
			if (deltaY < 0) {
				console.log("上滑")
				this.showGuide = false
			} else {
				this.showGuide = false
				console.log("下滑")
			}
		} else {
			console.log("可能是误触！")
		}
	},
	toWebView(url) {
		uni.navigateTo({
			url: '/pages/index/webView?path=' + url
		})
	},
}